package com.iptv.grape.domain;

import com.iptv.grape.bu.GrapeContext;
import com.iptv.grape.ui.control.ad.ListViewUI;
import com.iptv.grape.util.CommUtil;

import java.util.List;

// 直播菜单的顶层对象
public class TopMenu implements Comparable<TopMenu>,IListViewShowItem{
    // 显示的文本
    private String text;
    // 编码
    private String code;
    // 排序码
    private int sort;

    public String getText() {
        return text;
    }

    @Override
    public List<IListViewShowItem> getChList() {

        return GrapeContext.curGrapeContext().getChannelTypeListViewShowItem(this.getCode());
    }

    @Override
    public void itemClick(List<IListViewShowItem> dataSouce, int pos, ListViewUI listViewUI) {

    }

    @Override
    public ListViewStyle getListViewStyle(){

        return new ListViewStyle(100,"topMenuListItem",
                "TopMenu",7,3,3, 55,null);
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    @Override
    public int compareTo(TopMenu topMenu) {
        return this.sort - topMenu.sort;
    }



}
